//---------------------------------------------------------------------
// <copyright file="BadEntitySet.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Data.Edm.Validation;

namespace Microsoft.Data.Edm.Library.Internal
{
    /// <summary>
    /// Represents a semantically invalid EDM entity set.
    /// </summary>
    internal class BadEntitySet : BadElement, IEdmEntitySet
    {
        private readonly string name;
        private readonly IEdmEntityContainer container;

        public BadEntitySet(string name, IEdmEntityContainer container, IEnumerable<EdmError> errors)
            : base(errors)
        {
            this.name = name ?? string.Empty;
            this.container = container;
        }

        public string Name
        {
            get { return this.name; }
        }

        public IEdmEntityType ElementType
        {
            get { return new BadEntityType(String.Empty, this.Errors); }
        }

        public EdmContainerElementKind ContainerElementKind
        {
            get { return EdmContainerElementKind.EntitySet; }
        }

        public IEdmEntityContainer Container
        {
            get { return this.container; }
        }

        public IEnumerable<IEdmNavigationTargetMapping> NavigationTargets
        {
            get { return Enumerable.Empty<IEdmNavigationTargetMapping>(); }
        }

        public IEdmEntitySet FindNavigationTarget(IEdmNavigationProperty property)
        {
            return null;
        }
    }
}
